package com.example.validation.controller;

import com.example.validation.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
public class UserController {

    @RequestMapping("/reg")
    public String reg(@Valid User user) {
        return user.toString();
    }

    @RequestMapping("/hi")
    public String hi() {
        int i = 10 / 0;
        return "hi,spring boot";
    }

}
